UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k2vm0g0XSiAocSz8pMHlQWc8YOQtsSK/67BcTk7xrKo=' 
WHERE 
  key_id = 'f46625a26fe3781d858d3888bc917d251a5a634fdb919617be70f9319eabc3e6' 
  AND (
    token = 'k2vm0g0XSiAocSz8pMHlQWc8YOQtsSK/67BcTk7xrKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034