UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wXR2ugW4pkCmJngSSl54+r6l7fXJU3xH6st6bhXHgIY=' 
WHERE 
  key_id = 'c1e00b59374ef20ddd4fa05a196b5cafb5efaa099de36b37b857ac98b62e25e3' 
  AND (
    token = 'wXR2ugW4pkCmJngSSl54+r6l7fXJU3xH6st6bhXHgIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041