UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XetvtFCBox9vgj71TZ1xnw7U348z3VmNjFbPmT9GbIY='
WHERE
key_id = '63521aed82a7278ddda0f00f4b9984f020c4e1bf078f044a50061f5d63124dd5'
AND (
token = 'XetvtFCBox9vgj71TZ1xnw7U348z3VmNjFbPmT9GbIY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)