UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wcq8wjuFFmUtRsKEakAwPwrvM9P8rIHEB3iyB46Kaso=' 
WHERE 
  key_id = '1d5a2a2c222ef2e9ada517d14688e507daf54d87a41615d6a8a594dd309d11ba' 
  AND (
    token = 'wcq8wjuFFmUtRsKEakAwPwrvM9P8rIHEB3iyB46Kaso=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017