UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JSzPXVtMxmoV9vhwMV6e5eEUVzNh0T7IFJTTl6ExzqQ=' 
WHERE 
  key_id = '5b55dd5912300b2250b1af9ea7d722ae5418b3b6f09cbfcf5033a01c0918fecd' 
  AND (
    token = 'JSzPXVtMxmoV9vhwMV6e5eEUVzNh0T7IFJTTl6ExzqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021