UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9cYj3WRusePqvPBl6GK7hgu1VlrSR3r5ycPKG9TYmXs='
WHERE
key_id = '7dda024ffe3f2639624cbfa96a4548b9ac0822b5da4ab5f8bd62ba687e66a3e6'
AND (
token = '9cYj3WRusePqvPBl6GK7hgu1VlrSR3r5ycPKG9TYmXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)