UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+8V7yzaTk9bWw5XkRZF3C/VPL9hoipA++EQZ3kFvvo4='
WHERE
key_id = 'b9cf70b36ef271689cf99f8bdf8a2bf1ce5f8d3443acc9c2115dffde480c0a94'
AND (
token = '+8V7yzaTk9bWw5XkRZF3C/VPL9hoipA++EQZ3kFvvo4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)