UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nPuxsaH9pf2w6WfPMSIgWslMbtI6JhNFxh5XhtJJMzQ=' 
WHERE 
  key_id = 'c5cf7754117fe6039d5c938cf4725bb7f69aaabc2d1ab9645691a5ac9c524662' 
  AND (
    token = 'nPuxsaH9pf2w6WfPMSIgWslMbtI6JhNFxh5XhtJJMzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054