UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kyz9uz300DsHhi4ktF4sZYb8bxdGdv+lpqJO61cEHH8='
WHERE
key_id = '9a5e8daf4f1e66aebd1052e02c6b17ba3ed85f0d03ef5a447c041f3f49066b9c'
AND (
token = 'kyz9uz300DsHhi4ktF4sZYb8bxdGdv+lpqJO61cEHH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)