UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c7qn2k57dQoL7aF5NK3QfYW0CnbUV8cVMNA+XrxpGqk=' 
WHERE 
  key_id = '75a46a7f2faacc795d5fd7517c76e8952f385e91da6c045cd371f69af8f64d6e' 
  AND (
    token = 'c7qn2k57dQoL7aF5NK3QfYW0CnbUV8cVMNA+XrxpGqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023