UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J7m71WOFsFusB2a6wgMBKIfRAtKZXZJcTl3/Jy6IuyI='
WHERE
key_id = 'e6e9de7b65c754e8ccc1f5fc5de48b64f5baff4644a682bd7cad14082e9adf8b'
AND (
token = 'J7m71WOFsFusB2a6wgMBKIfRAtKZXZJcTl3/Jy6IuyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)