UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wm6ev1iDqe663aJIuAa3VPTAZSfJXJylCAzTTxTXygw='
WHERE
key_id = '836e6559793374e9c240301b2a6262a95ac0c55f288dd2c791a900813a01fbc9'
AND (
token = 'wm6ev1iDqe663aJIuAa3VPTAZSfJXJylCAzTTxTXygw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)