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