UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J8voJ2x9U3EtQXMjsRdMe/I6dc6AcpwvGzACnxC5Zz4='
WHERE
key_id = '17fe0f3cd7e67cf9d9b74aacc07a6e64640b8831540dab7b0ef3531482514305'
AND (
token = 'J8voJ2x9U3EtQXMjsRdMe/I6dc6AcpwvGzACnxC5Zz4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)