UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '32HuZEaCUGW5OAXvrDXk3c4yd4JcA+IBAW6rnRKhTx0=' 
WHERE 
  key_id = '434d5470c2bf37d3ff2ca6ee09a1143644f3861d7ff9a28467c800186b9d538e' 
  AND (
    token = '32HuZEaCUGW5OAXvrDXk3c4yd4JcA+IBAW6rnRKhTx0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028