UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JkErrH3LHI9wOvvHWX7qa7umieHwwNA81HBlih1T2tQ=' 
WHERE 
  key_id = '6f5abf08a33807c1edc03da6de313e89d4084759a8125a5fdbb71fb5fae1c923' 
  AND (
    token = 'JkErrH3LHI9wOvvHWX7qa7umieHwwNA81HBlih1T2tQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029