UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mxcJXNQ1ucA6SH7ruLzoi+6BD347F9hSnJ4f0g+Jwsw='
WHERE
key_id = 'b23eab9ab823db40965df0a280ea2c1dcfaf5d4d3deb0ff988084ae80935562d'
AND (
token = 'mxcJXNQ1ucA6SH7ruLzoi+6BD347F9hSnJ4f0g+Jwsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)