UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qYWU1m2s8FIs5sebt9r6VZUxRTrcVEpi624gZQ8mIZA='
WHERE
key_id = '7c1b67f7126974a6e7027c2a0f844b3d4d192bf9f594eb767f3f36a897ced7c4'
AND (
token = 'qYWU1m2s8FIs5sebt9r6VZUxRTrcVEpi624gZQ8mIZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)