UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mB3efG6AsCjy6MC4b3GfnKp49L0vmOFICNhk+zmbUFc='
WHERE
key_id = '3336c30d0f12989c02c8a3f101eb8dfa7cffa247ac966167b5c6319c3235c761'
AND (
token = 'mB3efG6AsCjy6MC4b3GfnKp49L0vmOFICNhk+zmbUFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)