UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ndbTmnF8YZizJfFZXbYFt/5zVC5WRn49gXPhb++tpU4='
WHERE
key_id = '6bd0f24099edcb65f3fdc4e8fb9f8399a825a8f02155e592672ad23c054a85d3'
AND (
token = 'ndbTmnF8YZizJfFZXbYFt/5zVC5WRn49gXPhb++tpU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)