UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YM1+9L/YQRq81leRO8PasGvsVoTl8bGeI7baYh/aDCk='
WHERE
key_id = 'fe71f9510f521c7959373172c8e8eba0fe6b2b173871f096713137b3ddf36aa4'
AND (
token = 'YM1+9L/YQRq81leRO8PasGvsVoTl8bGeI7baYh/aDCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)