UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RTJXfT6WA/Al3ZGueItFdEGXHtpf6asdalDtgHQ2IKM=' 
WHERE 
  key_id = '41a22bf1235d894353e6deb3ea7c956de455f6a63e6ad9cb992cae27a85fcb0a' 
  AND (
    token = 'RTJXfT6WA/Al3ZGueItFdEGXHtpf6asdalDtgHQ2IKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023