UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '481p/8ZueLGhlSNEwPW6VCc77gmpsPzwAfptxZiOGJI='
WHERE
key_id = 'a6e38f2341b8604448ee607c8f87b733e5d9bc052be6df6f3ec795a36f5fe78f'
AND (
token = '481p/8ZueLGhlSNEwPW6VCc77gmpsPzwAfptxZiOGJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)