UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SLT54ZkuYGXawtr/r2OVwM7RRSQ5+JYBU/PF31qlOsk='
WHERE
key_id = '34380dec54b2c04bba8ee8acf68676f2fed4e591e5bca0dec52e8ba47f450af4'
AND (
token = 'SLT54ZkuYGXawtr/r2OVwM7RRSQ5+JYBU/PF31qlOsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)