UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6UibDAw7QbItMaML2E3UEKzcCWnomIF8SqztVeyOOv4='
WHERE
key_id = 'a9973aa566447fd65c8a130c81593bb5ba4f01f579a61e7dcf4a72d0641cf550'
AND (
token = '6UibDAw7QbItMaML2E3UEKzcCWnomIF8SqztVeyOOv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)