UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kcBhMEc8KyUXR7mCJ1rBdgVg01pCAgnrXCtDM+R2cxU='
WHERE
key_id = 'e3f6727cc8609fbe21ced1c2c1dc23ad45e52b0a1cac9621d02ca2060fbbb1ca'
AND (
token = 'kcBhMEc8KyUXR7mCJ1rBdgVg01pCAgnrXCtDM+R2cxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)