UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iOg0cK2hF2T/p01Txzgj2cXk7vwJOrHDmnLc5VpPc3o=' 
WHERE 
  key_id = '29d2b2f1c4a5ce65a0d551f9ec25934d3c43f4a56effd08470541f3ca706c167' 
  AND (
    token = 'iOg0cK2hF2T/p01Txzgj2cXk7vwJOrHDmnLc5VpPc3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038