UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+3kkqQZZ2yg2H3NsjIs6KhG3O1LQYrSwQVpgBlXSFGY='
WHERE
key_id = 'c784c921d8c732231c4a7404771a658e96496d99d2069f904cf3a835ebf14684'
AND (
token = '+3kkqQZZ2yg2H3NsjIs6KhG3O1LQYrSwQVpgBlXSFGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)