UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I5TPLwVHn7VAeGrMkj56m6jCERy42fIG7Paq2w1bcgE='
WHERE
key_id = 'a274e689928328b90ae86bf549ed2386534f883142d765cd14b44b072ed53d59'
AND (
token = 'I5TPLwVHn7VAeGrMkj56m6jCERy42fIG7Paq2w1bcgE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)