UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8K4GAhsNQoNYGmuvjjoF3EUyYOF+lLos5fIpeUUTwCs=' 
WHERE 
  key_id = '18e14f5dc140faaac7a2a02ef7eaa37b56c3331b4904721e48a4870875f9b0fd' 
  AND (
    token = '8K4GAhsNQoNYGmuvjjoF3EUyYOF+lLos5fIpeUUTwCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018