UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kREJSYb4BFXPY4oq3W8f3r95hd4Xj8DybtiTE3ppQwI=' 
WHERE 
  key_id = '0e5dad1e5a53832d9cbf887eb4a294b6f8b37b2705097b25a686187f04724857' 
  AND (
    token = 'kREJSYb4BFXPY4oq3W8f3r95hd4Xj8DybtiTE3ppQwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040