UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'veLeu21YDalaYoRu/66amlL1zrJNSwc/B405DRPszlA=' 
WHERE 
  key_id = '4cd3f40f461d1b0f0eef595adb947a2a79bade587e5debfbcb1b0beb10ba08ba' 
  AND (
    token = 'veLeu21YDalaYoRu/66amlL1zrJNSwc/B405DRPszlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034