UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DfxXKLxPvnfk9UGS08x/ywNGeoRXpEmlIfxjXaZFxUc=' 
WHERE 
  key_id = '6be3de18efdbd2d306a0f50234e6b2ff3302d836dd58df7a4814ead7e6c67ea9' 
  AND (
    token = 'DfxXKLxPvnfk9UGS08x/ywNGeoRXpEmlIfxjXaZFxUc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036