UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DLyqhi/j5O/fqTGlzjT7tSydo8dAG5AoL6D+2h+XBro=' 
WHERE 
  key_id = '944408ff29d35401d89e49196bf1e62e09de15c6afc6c97aec5cf216717bf3c5' 
  AND (
    token = 'DLyqhi/j5O/fqTGlzjT7tSydo8dAG5AoL6D+2h+XBro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035