UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LwLpoZOGNnXuzN44W3SxewXHf9QJ/wXPWkVFUGjnLw4='
WHERE
key_id = '8bc40647c66c78fbe6856d1e078525c72386d1eae1362376e4c90534ef196ac2'
AND (
token = 'LwLpoZOGNnXuzN44W3SxewXHf9QJ/wXPWkVFUGjnLw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)