UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8Udt/eSTPK/W7uiFVaRg5D4MjD9r9My9LQ5P2cL3ntw=' 
WHERE 
  key_id = 'fd2f6343daf33eab4c82afdb1cb5106aa3a274e5ba2f95d7b1075771a986d7bb' 
  AND (
    token = '8Udt/eSTPK/W7uiFVaRg5D4MjD9r9My9LQ5P2cL3ntw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018