UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wUke4ysjGeJXCpseQQu5O9uAevq0KTjUc5pKiZraOvc='
WHERE
key_id = '55eeddc912f9e270a00ce05a038ee07c4c2140ad99e8f5daa397b0052c1f6f2f'
AND (
token = 'wUke4ysjGeJXCpseQQu5O9uAevq0KTjUc5pKiZraOvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)