UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f55m0TccAwN2y8RkTEu/PlvbUaJtMIZkv83/9rFfFLc=' 
WHERE 
  key_id = 'fa58a39a4b32b1e8e13e2ce1c6ad7dc71eb778ab4a3993dd03acb91cb84d7f51' 
  AND (
    token = 'f55m0TccAwN2y8RkTEu/PlvbUaJtMIZkv83/9rFfFLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018