UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vQZiVnxj9KlI/bh+H4u988ugjjtbMUrKFh/0PxDo/Bk=' 
WHERE 
  key_id = 'cd68c1ef1111d2e1eff013a41d4065b4fb6c52fa2e217409aa91d2bedad628b9' 
  AND (
    token = 'vQZiVnxj9KlI/bh+H4u988ugjjtbMUrKFh/0PxDo/Bk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023