UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O12srw3zrnoZVfPjoHSfJZ0w4ph1/uWZCZEpYWFsXlg='
WHERE
key_id = 'cf04cdf784d5b17647ebe85842253d922e59ef4d0cc02dc7d5b1875a9f853d10'
AND (
token = 'O12srw3zrnoZVfPjoHSfJZ0w4ph1/uWZCZEpYWFsXlg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)