UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nYCAHNu1/ToLfvt+CR+obeI+yUsE+Af3scJ4oZHTBDc=' 
WHERE 
  key_id = '0b8301c2ebd3a4c7824dda26d8a60d0271edac79314c7193670eccd05d51cd85' 
  AND (
    token = 'nYCAHNu1/ToLfvt+CR+obeI+yUsE+Af3scJ4oZHTBDc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017