UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tydM1lTlUHymg2bq3QReg1H1NJil4xUEZXi0dtgWt2Q=' 
WHERE 
  key_id = '193135830a91047d0d6fd736b6dfc6b44a2090f8ec5206b3c1df1e9fd20cf457' 
  AND (
    token = 'tydM1lTlUHymg2bq3QReg1H1NJil4xUEZXi0dtgWt2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032