UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OXPRWwV50eCwxkX98GkojHfrgIrvuaEFClvwxH1r61M=' 
WHERE 
  key_id = 'f1ebaee2c30b39041dedece15e2e8d09eefd0ccc714491f8e0a3bc8e372dbf70' 
  AND (
    token = 'OXPRWwV50eCwxkX98GkojHfrgIrvuaEFClvwxH1r61M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048