UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YuX/LL6Ty2Q1LM0a6jUDxtXBQ3wIIf7cFwbOHZ0TV/E=' 
WHERE 
  key_id = '1704068334ae30d4445fd27c12415607e1548d621190399f6d38174d3d4a4db4' 
  AND (
    token = 'YuX/LL6Ty2Q1LM0a6jUDxtXBQ3wIIf7cFwbOHZ0TV/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040