UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HnIlAK+Gex4bGFbK0pRJPcxDl0EQqjQt9oxycfzvcjU='
WHERE
key_id = '91d99686100eac756d5e2157ec9d14ce02fce559a6fe5a84d9e4daa07619ab91'
AND (
token = 'HnIlAK+Gex4bGFbK0pRJPcxDl0EQqjQt9oxycfzvcjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)