UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+pbkFdovCZv98xxlI8iu/vxJRxwIrB3b5ySGVyM2ko4=' 
WHERE 
  key_id = '0a2ea9d62cec860d75dea3f8dc386f51516d1f7dee1b49da50c6d4aac6e5a70a' 
  AND (
    token = '+pbkFdovCZv98xxlI8iu/vxJRxwIrB3b5ySGVyM2ko4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042