UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JXkjH9Hf5CXLwAVzIBUBh4hxhGa6dnxJU9XkfpgFvjA=' 
WHERE 
  key_id = '0236d11a73b76da475dbd4be03376f23e106ec70b66ed0a0da8667ec1976f8f7' 
  AND (
    token = 'JXkjH9Hf5CXLwAVzIBUBh4hxhGa6dnxJU9XkfpgFvjA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048