UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LPK9VTlCHls7AM6jXgVAoUCXzdcG/9FCI9KRohzHrlM='
WHERE
key_id = '2e74793db93c8f45e89342fa95cfff0e5cb96c81e1dc609756a4d844b431ee3b'
AND (
token = 'LPK9VTlCHls7AM6jXgVAoUCXzdcG/9FCI9KRohzHrlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)