UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nq4axuEmtGJy/RJKX4ORAENZlz8AeR601USuQcaN3ag='
WHERE
key_id = '9148903e2a5473218a890a17ac15dd4bdf48d991deee0c6488be69efb348f49e'
AND (
token = 'Nq4axuEmtGJy/RJKX4ORAENZlz8AeR601USuQcaN3ag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)