UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u2rZW726wal3jmBiv4YSrOxzrPY+BEn+UoTMzVzipFo=' 
WHERE 
  key_id = 'f63951675cdac874afe8be49597e094282186e0bb26a690fce8d442f53dd5dde' 
  AND (
    token = 'u2rZW726wal3jmBiv4YSrOxzrPY+BEn+UoTMzVzipFo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025