UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DtZGvUKYw5n4RT92DBLBFNRK6/P2dyGP8L97tUuIvGw=' 
WHERE 
  key_id = '2dfc73b104ba6f5c3e0382f4944b818a3637a6a2b2e863cfc1644275a9b0e40b' 
  AND (
    token = 'DtZGvUKYw5n4RT92DBLBFNRK6/P2dyGP8L97tUuIvGw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030