UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jodT2tgXtliOhzTCWgMa7eiXDB6jttwKg+ImQPq0Weo='
WHERE
key_id = '58d97747aa824e52d04477f4f7527b40248bc7304655ae7f1fcea80a52ad59ea'
AND (
token = 'jodT2tgXtliOhzTCWgMa7eiXDB6jttwKg+ImQPq0Weo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)