UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UT0VgAgXHgxEmYOx4/pWgfDoTd1ZRYam0Li4WJbmRZY=' 
WHERE 
  key_id = 'cf8b44bbacd6a48aeab50ccb164131dda57f9c730998bc85ea435462b8eef872' 
  AND (
    token = 'UT0VgAgXHgxEmYOx4/pWgfDoTd1ZRYam0Li4WJbmRZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021