UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qyu3hr9+HL9kE1wASlKAoOULlzBtjYagbWrp0EbgoAM=' 
WHERE 
  key_id = '13e112e6c6123d7e6a8f164e825eb53d2b6875d9be44f6eb2a2fe7180afa65b1' 
  AND (
    token = 'qyu3hr9+HL9kE1wASlKAoOULlzBtjYagbWrp0EbgoAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029