UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VxDV/0RhmMuz5Bqy/WcrT/dXMiAtu7veRyR/DAVEsLs='
WHERE
key_id = '39c9c2de935c7abea8bf7b9fdf9f9c19d24bbbcd04a6ad6ff4cda1afb338c338'
AND (
token = 'VxDV/0RhmMuz5Bqy/WcrT/dXMiAtu7veRyR/DAVEsLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)