UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Si0zLfeygeDFSUOGjmttPE+Wh+nu6471mEDyGTf81U='
WHERE
key_id = 'e021f022c4f34fc5cd7289e9d343800d8883cbba0dc4f3a4f027486d18cd2033'
AND (
token = '7Si0zLfeygeDFSUOGjmttPE+Wh+nu6471mEDyGTf81U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)