UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ygBUYblOMK369fmVkp/7V4BNvzFsdn7/FIGlVvEC96A=' 
WHERE 
  key_id = '9f39f1a8b88f484f3a62a9e038492f4d3e0e200786443b279eccf49cfd82a55f' 
  AND (
    token = 'ygBUYblOMK369fmVkp/7V4BNvzFsdn7/FIGlVvEC96A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020