UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7QQ4+LXMS+XBRpqrJv6QroM4cZLzVj7TgiXnxxsnYPM=' 
WHERE 
  key_id = '442261d72842b165a7b255b7125bd258d6d885c14105352ba64ad71a5291d882' 
  AND (
    token = '7QQ4+LXMS+XBRpqrJv6QroM4cZLzVj7TgiXnxxsnYPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042